package com.aidex.biz.smy.controller;

import com.aidex.biz.smy.dto.BaseDTO;
import com.aidex.biz.smy.service.HitService;
import com.aidex.biz.smy.vo.BaseVO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xyb
 * @Description 撞库接口
 * @since 14:36 2022/11/10
 */
@RestController
@Validated
@RequiredArgsConstructor
public class HitController {

    private final HitService hitService;

    /**
     * @Description 撞库
     * @author xyb
     * @since 14:40 2022/11/10
     */
    @PostMapping("/check")
    public BaseVO hitUser(@RequestBody BaseDTO param) {
        BaseVO baseVO = hitService.handlerHit(param);
        return baseVO;
    }

    /**
     * @Description 撞库
     * @author xyb
     * @since 14:40 2022/11/10
     */
    @PostMapping("/infoSubmit")
    public BaseVO commitUserInfo(@RequestBody BaseDTO param) {
        BaseVO baseVO = hitService.handlerHit(param);
        return baseVO;
    }


}
